<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>第十一课 引用类型（Function类型3）</title>
</head> 
<body>
    <script>
        function fn1(a,b){
            console.log(a + b);
        }
        var obj = {
            x:100,
            y:200,
            z:300
            // fn1:function(a,b){
            //     console.log(a + b);
            // }
        };
        // obj.fn1();
        fn1.apply(obj,[1,2]);
        fn1.call(obj,1,2);        

        function fn2(c,d){
            return fn1.apply(this,arguments);
        }
        // fn2(3,6);
        // fn1.apply(obj,[1,2]);
        // fn1.call(obj,1,2);
        // fn1(1,2);
        // console.log(fn1.length);
        // console.log(fn1.prototype);
        // console.log(fn1.toString());//从其他对象继承获取得到
    </script>
</body> 
</html>